import Util;
import RPC;
import EndpointUtil;

extends RPC;

init(config: RPC.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('alidns', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

model DescribeDohDomainStatisticsSummaryRequest = {
  lang?: string(name='Lang'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  domainName?: string(name='DomainName'),
}

model DescribeDohDomainStatisticsSummaryResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageSize: integer(name='PageSize'),
  pageNumber: integer(name='PageNumber'),
  statistics: [
    {
      domainName: string(name='DomainName'),
      v4HttpCount: long(name='V4HttpCount'),
      v6HttpCount: long(name='V6HttpCount'),
      v4HttpsCount: long(name='V4HttpsCount'),
      v6HttpsCount: long(name='V6HttpsCount'),
      totalCount: long(name='TotalCount'),
      ipCount: long(name='IpCount'),
      httpCount: long(name='HttpCount'),
      httpsCount: long(name='HttpsCount'),
    }
  ](name='Statistics'),
}

async function describeDohDomainStatisticsSummaryWithOptions(request: DescribeDohDomainStatisticsSummaryRequest, runtime: Util.RuntimeOptions): DescribeDohDomainStatisticsSummaryResponse {
  Util.validateModel(request);
  return doRequest('DescribeDohDomainStatisticsSummary', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDohDomainStatisticsSummary(request: DescribeDohDomainStatisticsSummaryRequest): DescribeDohDomainStatisticsSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDohDomainStatisticsSummaryWithOptions(request, runtime);
}

model DescribeDohAccountStatisticsRequest = {
  lang?: string(name='Lang'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
}

model DescribeDohAccountStatisticsResponse = {
  requestId: string(name='RequestId'),
  statistics: [
    {
      timestamp: long(name='Timestamp'),
      v4HttpCount: long(name='V4HttpCount'),
      v6HttpCount: long(name='V6HttpCount'),
      v4HttpsCount: long(name='V4HttpsCount'),
      v6HttpsCount: long(name='V6HttpsCount'),
      totalCount: long(name='TotalCount'),
    }
  ](name='Statistics'),
}

async function describeDohAccountStatisticsWithOptions(request: DescribeDohAccountStatisticsRequest, runtime: Util.RuntimeOptions): DescribeDohAccountStatisticsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDohAccountStatistics', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDohAccountStatistics(request: DescribeDohAccountStatisticsRequest): DescribeDohAccountStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDohAccountStatisticsWithOptions(request, runtime);
}

model DescribeDohSubDomainStatisticsRequest = {
  lang?: string(name='Lang'),
  subDomain: string(name='SubDomain'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
}

model DescribeDohSubDomainStatisticsResponse = {
  requestId: string(name='RequestId'),
  statistics: [
    {
      timestamp: long(name='Timestamp'),
      v4HttpCount: long(name='V4HttpCount'),
      v4HttpsCount: long(name='V4HttpsCount'),
      v6HttpCount: long(name='V6HttpCount'),
      v6HttpsCount: long(name='V6HttpsCount'),
      totalCount: long(name='TotalCount'),
    }
  ](name='Statistics'),
}

async function describeDohSubDomainStatisticsWithOptions(request: DescribeDohSubDomainStatisticsRequest, runtime: Util.RuntimeOptions): DescribeDohSubDomainStatisticsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDohSubDomainStatistics', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDohSubDomainStatistics(request: DescribeDohSubDomainStatisticsRequest): DescribeDohSubDomainStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDohSubDomainStatisticsWithOptions(request, runtime);
}

model DescribeDohSubDomainStatisticsSummaryRequest = {
  lang?: string(name='Lang'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  subDomain?: string(name='SubDomain'),
  domainName?: string(name='DomainName'),
}

model DescribeDohSubDomainStatisticsSummaryResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageSize: integer(name='PageSize'),
  pageNumber: integer(name='PageNumber'),
  statistics: [
    {
      subDomain: string(name='SubDomain'),
      v4HttpCount: long(name='V4HttpCount'),
      v6HttpCount: long(name='V6HttpCount'),
      v4HttpsCount: long(name='V4HttpsCount'),
      v6HttpsCount: long(name='V6HttpsCount'),
      totalCount: long(name='TotalCount'),
      ipCount: long(name='IpCount'),
      httpCount: long(name='HttpCount'),
      httpsCount: long(name='HttpsCount'),
    }
  ](name='Statistics'),
}

async function describeDohSubDomainStatisticsSummaryWithOptions(request: DescribeDohSubDomainStatisticsSummaryRequest, runtime: Util.RuntimeOptions): DescribeDohSubDomainStatisticsSummaryResponse {
  Util.validateModel(request);
  return doRequest('DescribeDohSubDomainStatisticsSummary', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDohSubDomainStatisticsSummary(request: DescribeDohSubDomainStatisticsSummaryRequest): DescribeDohSubDomainStatisticsSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDohSubDomainStatisticsSummaryWithOptions(request, runtime);
}

model DescribeDohDomainStatisticsRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
}

model DescribeDohDomainStatisticsResponse = {
  requestId: string(name='RequestId'),
  statistics: [
    {
      timestamp: long(name='Timestamp'),
      v4HttpCount: long(name='V4HttpCount'),
      v6HttpCount: long(name='V6HttpCount'),
      v4HttpsCount: long(name='V4HttpsCount'),
      v6HttpsCount: long(name='V6HttpsCount'),
      totalCount: long(name='TotalCount'),
    }
  ](name='Statistics'),
}

async function describeDohDomainStatisticsWithOptions(request: DescribeDohDomainStatisticsRequest, runtime: Util.RuntimeOptions): DescribeDohDomainStatisticsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDohDomainStatistics', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDohDomainStatistics(request: DescribeDohDomainStatisticsRequest): DescribeDohDomainStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDohDomainStatisticsWithOptions(request, runtime);
}

model DescribeDohUserInfoRequest = {
  lang?: string(name='Lang'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
}

model DescribeDohUserInfoResponse = {
  requestId: string(name='RequestId'),
  pdnsId: long(name='PdnsId'),
  domainCount: integer(name='DomainCount'),
  subDomainCount: integer(name='SubDomainCount'),
}

async function describeDohUserInfoWithOptions(request: DescribeDohUserInfoRequest, runtime: Util.RuntimeOptions): DescribeDohUserInfoResponse {
  Util.validateModel(request);
  return doRequest('DescribeDohUserInfo', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDohUserInfo(request: DescribeDohUserInfoRequest): DescribeDohUserInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDohUserInfoWithOptions(request, runtime);
}

model ListTagResourcesRequest = {
  lang?: string(name='Lang'),
  resourceType: string(name='ResourceType'),
  tag?: [
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  resourceId?: [ string ](name='ResourceId'),
  nextToken?: string(name='NextToken'),
}

model ListTagResourcesResponse = {
  requestId: string(name='RequestId'),
  nextToken: string(name='NextToken'),
  tagResources: [
    {
      tagKey: string(name='TagKey'),
      tagValue: string(name='TagValue'),
      resourceId: string(name='ResourceId'),
      resourceType: string(name='ResourceType'),
    }
  ](name='TagResources'),
}

async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  return doRequest('ListTagResources', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model TagResourcesRequest = {
  lang?: string(name='Lang'),
  resourceType: string(name='ResourceType'),
  tag: [
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  resourceId: [ string ](name='ResourceId'),
}

model TagResourcesResponse = {
  requestId: string(name='RequestId'),
}

async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  return doRequest('TagResources', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest = {
  lang?: string(name='Lang'),
  resourceType: string(name='ResourceType'),
  all?: boolean(name='All'),
  resourceId: [ string ](name='ResourceId'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponse = {
  requestId: string(name='RequestId'),
}

async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  return doRequest('UntagResources', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model DescribeTagsRequest = {
  lang?: string(name='Lang'),
  resourceType: string(name='ResourceType'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
}

model DescribeTagsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  tags: [
    {
      key: string(name='Key'),
      values: [ string ](name='Values'),
    }
  ](name='Tags'),
}

async function describeTagsWithOptions(request: DescribeTagsRequest, runtime: Util.RuntimeOptions): DescribeTagsResponse {
  Util.validateModel(request);
  return doRequest('DescribeTags', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeTags(request: DescribeTagsRequest): DescribeTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagsWithOptions(request, runtime);
}

model CopyGtmConfigRequest = {
  lang?: string(name='Lang'),
  sourceId: string(name='SourceId'),
  targetId: string(name='TargetId'),
  copyType: string(name='CopyType'),
}

model CopyGtmConfigResponse = {
  requestId: string(name='RequestId'),
}

async function copyGtmConfigWithOptions(request: CopyGtmConfigRequest, runtime: Util.RuntimeOptions): CopyGtmConfigResponse {
  Util.validateModel(request);
  return doRequest('CopyGtmConfig', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function copyGtmConfig(request: CopyGtmConfigRequest): CopyGtmConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return copyGtmConfigWithOptions(request, runtime);
}

model DescribeDomainDnssecInfoRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
}

model DescribeDomainDnssecInfoResponse = {
  requestId: string(name='RequestId'),
  domainName: string(name='DomainName'),
  status: string(name='Status'),
  dsRecord: string(name='DsRecord'),
  digest: string(name='Digest'),
  digestType: string(name='DigestType'),
  algorithm: string(name='Algorithm'),
  publicKey: string(name='PublicKey'),
  keyTag: string(name='KeyTag'),
  flags: string(name='Flags'),
}

async function describeDomainDnssecInfoWithOptions(request: DescribeDomainDnssecInfoRequest, runtime: Util.RuntimeOptions): DescribeDomainDnssecInfoResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainDnssecInfo', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainDnssecInfo(request: DescribeDomainDnssecInfoRequest): DescribeDomainDnssecInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainDnssecInfoWithOptions(request, runtime);
}

model SetDomainDnssecStatusRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  status: string(name='Status'),
}

model SetDomainDnssecStatusResponse = {
  requestId: string(name='RequestId'),
}

async function setDomainDnssecStatusWithOptions(request: SetDomainDnssecStatusRequest, runtime: Util.RuntimeOptions): SetDomainDnssecStatusResponse {
  Util.validateModel(request);
  return doRequest('SetDomainDnssecStatus', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function setDomainDnssecStatus(request: SetDomainDnssecStatusRequest): SetDomainDnssecStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDomainDnssecStatusWithOptions(request, runtime);
}

model TransferDomainRequest = {
  lang?: string(name='Lang'),
  domainNames: string(name='DomainNames'),
  remark?: string(name='Remark'),
  targetUserId: long(name='TargetUserId'),
}

model TransferDomainResponse = {
  requestId: string(name='RequestId'),
  taskId: long(name='TaskId'),
}

async function transferDomainWithOptions(request: TransferDomainRequest, runtime: Util.RuntimeOptions): TransferDomainResponse {
  Util.validateModel(request);
  return doRequest('TransferDomain', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function transferDomain(request: TransferDomainRequest): TransferDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return transferDomainWithOptions(request, runtime);
}

model DescribeTransferDomainsRequest = {
  lang?: string(name='Lang'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  transferType: string(name='TransferType'),
  domainName?: string(name='DomainName'),
  fromUserId?: long(name='FromUserId'),
  targetUserId?: long(name='TargetUserId'),
}

model DescribeTransferDomainsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  domainTransfers: {
    domainTransfer: [
      {
        domainName: string(name='DomainName'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        fromUserId: long(name='FromUserId'),
        targetUserId: long(name='TargetUserId'),
        id: long(name='Id'),
      }
    ](name='DomainTransfer'),
  }(name='DomainTransfers'),
}

async function describeTransferDomainsWithOptions(request: DescribeTransferDomainsRequest, runtime: Util.RuntimeOptions): DescribeTransferDomainsResponse {
  Util.validateModel(request);
  return doRequest('DescribeTransferDomains', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeTransferDomains(request: DescribeTransferDomainsRequest): DescribeTransferDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTransferDomainsWithOptions(request, runtime);
}

model AddDomainBackupRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  periodType: string(name='PeriodType'),
}

model AddDomainBackupResponse = {
  requestId: string(name='RequestId'),
  domainName: string(name='DomainName'),
  periodType: string(name='PeriodType'),
}

async function addDomainBackupWithOptions(request: AddDomainBackupRequest, runtime: Util.RuntimeOptions): AddDomainBackupResponse {
  Util.validateModel(request);
  return doRequest('AddDomainBackup', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addDomainBackup(request: AddDomainBackupRequest): AddDomainBackupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDomainBackupWithOptions(request, runtime);
}

model RetrieveDomainRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
}

model RetrieveDomainResponse = {
  requestId: string(name='RequestId'),
}

async function retrieveDomainWithOptions(request: RetrieveDomainRequest, runtime: Util.RuntimeOptions): RetrieveDomainResponse {
  Util.validateModel(request);
  return doRequest('RetrieveDomain', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function retrieveDomain(request: RetrieveDomainRequest): RetrieveDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return retrieveDomainWithOptions(request, runtime);
}

model DescribeGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  recoveryPlanId: long(name='RecoveryPlanId'),
}

model DescribeGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
  recoveryPlanId: long(name='RecoveryPlanId'),
  name: string(name='Name'),
  remark: string(name='Remark'),
  faultAddrPoolNum: integer(name='FaultAddrPoolNum'),
  status: string(name='Status'),
  lastExecuteTime: string(name='LastExecuteTime'),
  lastExecuteTimestamp: long(name='LastExecuteTimestamp'),
  lastRollbackTime: string(name='LastRollbackTime'),
  lastRollbackTimestamp: long(name='LastRollbackTimestamp'),
  createTime: string(name='CreateTime'),
  createTimestamp: long(name='CreateTimestamp'),
  updateTime: string(name='UpdateTime'),
  updateTimestamp: long(name='UpdateTimestamp'),
  faultAddrPools: {
    faultAddrPool: [
      {
        addrPoolId: string(name='AddrPoolId'),
        addrPoolName: string(name='AddrPoolName'),
        instanceId: string(name='InstanceId'),
        addrs: {
          addr: [
            {
              id: long(name='Id'),
              mode: string(name='Mode'),
              value: string(name='Value'),
            }
          ](name='Addr'),
        }(name='Addrs'),
      }
    ](name='FaultAddrPool'),
  }(name='FaultAddrPools'),
}

async function describeGtmRecoveryPlanWithOptions(request: DescribeGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): DescribeGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmRecoveryPlan(request: DescribeGtmRecoveryPlanRequest): DescribeGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmRecoveryPlanWithOptions(request, runtime);
}

model AddGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  name: string(name='Name'),
  remark?: string(name='Remark'),
  faultAddrPool: string(name='FaultAddrPool'),
}

model AddGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
  recoveryPlanId: string(name='RecoveryPlanId'),
}

async function addGtmRecoveryPlanWithOptions(request: AddGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): AddGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('AddGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addGtmRecoveryPlan(request: AddGtmRecoveryPlanRequest): AddGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGtmRecoveryPlanWithOptions(request, runtime);
}

model UpdateGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  recoveryPlanId: long(name='RecoveryPlanId'),
  name?: string(name='Name'),
  remark?: string(name='Remark'),
  faultAddrPool?: string(name='FaultAddrPool'),
}

model UpdateGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
}

async function updateGtmRecoveryPlanWithOptions(request: UpdateGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): UpdateGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('UpdateGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateGtmRecoveryPlan(request: UpdateGtmRecoveryPlanRequest): UpdateGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGtmRecoveryPlanWithOptions(request, runtime);
}

model DeleteGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  recoveryPlanId: long(name='RecoveryPlanId'),
}

model DeleteGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
}

async function deleteGtmRecoveryPlanWithOptions(request: DeleteGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): DeleteGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('DeleteGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function deleteGtmRecoveryPlan(request: DeleteGtmRecoveryPlanRequest): DeleteGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGtmRecoveryPlanWithOptions(request, runtime);
}

model DescribeGtmRecoveryPlansRequest = {
  lang?: string(name='Lang'),
  keyword?: string(name='Keyword'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
}

model DescribeGtmRecoveryPlansResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
  recoveryPlans: {
    recoveryPlan: [
      {
        recoveryPlanId: long(name='RecoveryPlanId'),
        name: string(name='Name'),
        remark: string(name='Remark'),
        faultAddrPoolNum: integer(name='FaultAddrPoolNum'),
        lastExecuteTime: string(name='LastExecuteTime'),
        lastExecuteTimestamp: long(name='LastExecuteTimestamp'),
        lastRollbackTime: string(name='LastRollbackTime'),
        lastRollbackTimestamp: long(name='LastRollbackTimestamp'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        updateTime: string(name='UpdateTime'),
        updateTimestamp: long(name='UpdateTimestamp'),
        status: string(name='Status'),
      }
    ](name='RecoveryPlan'),
  }(name='RecoveryPlans'),
}

async function describeGtmRecoveryPlansWithOptions(request: DescribeGtmRecoveryPlansRequest, runtime: Util.RuntimeOptions): DescribeGtmRecoveryPlansResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmRecoveryPlans', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmRecoveryPlans(request: DescribeGtmRecoveryPlansRequest): DescribeGtmRecoveryPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmRecoveryPlansWithOptions(request, runtime);
}

model DescribeGtmRecoveryPlanAvailableConfigRequest = {
  lang?: string(name='Lang'),
}

model DescribeGtmRecoveryPlanAvailableConfigResponse = {
  requestId: string(name='RequestId'),
  instances: {
    instance: [
      {
        instanceId: string(name='InstanceId'),
        instanceName: string(name='InstanceName'),
        addrPools: {
          addrPool: [
            {
              addrPoolId: string(name='AddrPoolId'),
              name: string(name='Name'),
            }
          ](name='AddrPool'),
        }(name='AddrPools'),
      }
    ](name='Instance'),
  }(name='Instances'),
}

async function describeGtmRecoveryPlanAvailableConfigWithOptions(request: DescribeGtmRecoveryPlanAvailableConfigRequest, runtime: Util.RuntimeOptions): DescribeGtmRecoveryPlanAvailableConfigResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmRecoveryPlanAvailableConfig', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmRecoveryPlanAvailableConfig(request: DescribeGtmRecoveryPlanAvailableConfigRequest): DescribeGtmRecoveryPlanAvailableConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmRecoveryPlanAvailableConfigWithOptions(request, runtime);
}

model ExecuteGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  recoveryPlanId: long(name='RecoveryPlanId'),
}

model ExecuteGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
}

async function executeGtmRecoveryPlanWithOptions(request: ExecuteGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): ExecuteGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('ExecuteGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function executeGtmRecoveryPlan(request: ExecuteGtmRecoveryPlanRequest): ExecuteGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeGtmRecoveryPlanWithOptions(request, runtime);
}

model RollbackGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  recoveryPlanId: long(name='RecoveryPlanId'),
}

model RollbackGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
}

async function rollbackGtmRecoveryPlanWithOptions(request: RollbackGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): RollbackGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('RollbackGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function rollbackGtmRecoveryPlan(request: RollbackGtmRecoveryPlanRequest): RollbackGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return rollbackGtmRecoveryPlanWithOptions(request, runtime);
}

model PreviewGtmRecoveryPlanRequest = {
  lang?: string(name='Lang'),
  recoveryPlanId: long(name='RecoveryPlanId'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
}

model PreviewGtmRecoveryPlanResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageSize: integer(name='PageSize'),
  pageNumber: integer(name='PageNumber'),
  previews: {
    preview: [
      {
        instanceId: string(name='InstanceId'),
        name: string(name='Name'),
        userDomainName: string(name='UserDomainName'),
        switchInfos: {
          switchInfo: [
            {
              strategyName: string(name='StrategyName'),
              content: string(name='Content'),
            }
          ](name='SwitchInfo'),
        }(name='SwitchInfos'),
      }
    ](name='Preview'),
  }(name='Previews'),
}

async function previewGtmRecoveryPlanWithOptions(request: PreviewGtmRecoveryPlanRequest, runtime: Util.RuntimeOptions): PreviewGtmRecoveryPlanResponse {
  Util.validateModel(request);
  return doRequest('PreviewGtmRecoveryPlan', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function previewGtmRecoveryPlan(request: PreviewGtmRecoveryPlanRequest): PreviewGtmRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return previewGtmRecoveryPlanWithOptions(request, runtime);
}

model GetTxtRecordForVerifyRequest = {
  lang?: string(name='Lang'),
  domainName?: string(name='DomainName'),
  type: string(name='Type'),
}

model GetTxtRecordForVerifyResponse = {
  requestId: string(name='RequestId'),
  domainName: string(name='DomainName'),
  RR: string(name='RR'),
  value: string(name='Value'),
}

async function getTxtRecordForVerifyWithOptions(request: GetTxtRecordForVerifyRequest, runtime: Util.RuntimeOptions): GetTxtRecordForVerifyResponse {
  Util.validateModel(request);
  return doRequest('GetTxtRecordForVerify', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function getTxtRecordForVerify(request: GetTxtRecordForVerifyRequest): GetTxtRecordForVerifyResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTxtRecordForVerifyWithOptions(request, runtime);
}

model DescribeDomainStatisticsRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  startDate: string(name='StartDate'),
  endDate?: string(name='EndDate'),
}

model DescribeDomainStatisticsResponse = {
  requestId: string(name='RequestId'),
  statistics: {
    statistic: [
      {
        timestamp: long(name='Timestamp'),
        count: long(name='Count'),
      }
    ](name='Statistic'),
  }(name='Statistics'),
}

async function describeDomainStatisticsWithOptions(request: DescribeDomainStatisticsRequest, runtime: Util.RuntimeOptions): DescribeDomainStatisticsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainStatistics', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainStatistics(request: DescribeDomainStatisticsRequest): DescribeDomainStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainStatisticsWithOptions(request, runtime);
}

model DescribeRecordStatisticsRequest = {
  lang?: string(name='Lang'),
  startDate: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  domainName: string(name='DomainName'),
  rr: string(name='Rr'),
}

model DescribeRecordStatisticsResponse = {
  requestId: string(name='RequestId'),
  statistics: {
    statistic: [
      {
        timestamp: long(name='Timestamp'),
        count: long(name='Count'),
      }
    ](name='Statistic'),
  }(name='Statistics'),
}

async function describeRecordStatisticsWithOptions(request: DescribeRecordStatisticsRequest, runtime: Util.RuntimeOptions): DescribeRecordStatisticsResponse {
  Util.validateModel(request);
  return doRequest('DescribeRecordStatistics', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeRecordStatistics(request: DescribeRecordStatisticsRequest): DescribeRecordStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecordStatisticsWithOptions(request, runtime);
}

model DescribeGtmInstanceSystemCnameRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
}

model DescribeGtmInstanceSystemCnameResponse = {
  requestId: string(name='RequestId'),
  systemCname: string(name='SystemCname'),
}

async function describeGtmInstanceSystemCnameWithOptions(request: DescribeGtmInstanceSystemCnameRequest, runtime: Util.RuntimeOptions): DescribeGtmInstanceSystemCnameResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmInstanceSystemCname', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmInstanceSystemCname(request: DescribeGtmInstanceSystemCnameRequest): DescribeGtmInstanceSystemCnameResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmInstanceSystemCnameWithOptions(request, runtime);
}

model DescribeInstanceDomainsRequest = {
  lang?: string(name='Lang'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  instanceId: string(name='InstanceId'),
}

model DescribeInstanceDomainsResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
  totalPages: integer(name='TotalPages'),
  instanceDomains: [
    {
      domainName: string(name='DomainName'),
      createTime: string(name='CreateTime'),
      createTimestamp: long(name='CreateTimestamp'),
    }
  ](name='InstanceDomains'),
}

async function describeInstanceDomainsWithOptions(request: DescribeInstanceDomainsRequest, runtime: Util.RuntimeOptions): DescribeInstanceDomainsResponse {
  Util.validateModel(request);
  return doRequest('DescribeInstanceDomains', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeInstanceDomains(request: DescribeInstanceDomainsRequest): DescribeInstanceDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceDomainsWithOptions(request, runtime);
}

model BindInstanceDomainsRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
  domainNames: string(name='DomainNames'),
}

model BindInstanceDomainsResponse = {
  requestId: string(name='RequestId'),
  successCount: integer(name='SuccessCount'),
  failedCount: integer(name='FailedCount'),
}

async function bindInstanceDomainsWithOptions(request: BindInstanceDomainsRequest, runtime: Util.RuntimeOptions): BindInstanceDomainsResponse {
  Util.validateModel(request);
  return doRequest('BindInstanceDomains', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function bindInstanceDomains(request: BindInstanceDomainsRequest): BindInstanceDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindInstanceDomainsWithOptions(request, runtime);
}

model UnbindInstanceDomainsRequest = {
  lang?: string(name='Lang'),
  domainNames: string(name='DomainNames'),
  instanceId: string(name='InstanceId'),
}

model UnbindInstanceDomainsResponse = {
  requestId: string(name='RequestId'),
  successCount: integer(name='SuccessCount'),
  failedCount: integer(name='FailedCount'),
}

async function unbindInstanceDomainsWithOptions(request: UnbindInstanceDomainsRequest, runtime: Util.RuntimeOptions): UnbindInstanceDomainsResponse {
  Util.validateModel(request);
  return doRequest('UnbindInstanceDomains', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function unbindInstanceDomains(request: UnbindInstanceDomainsRequest): UnbindInstanceDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindInstanceDomainsWithOptions(request, runtime);
}

model UpdateCustomLineRequest = {
  lang?: string(name='Lang'),
  lineName?: string(name='LineName'),
  ipSegment?: [
    {
      startIp?: string(name='StartIp'),
      endIp?: string(name='EndIp'),
    }
  ](name='IpSegment'),
  lineId: long(name='LineId'),
}

model UpdateCustomLineResponse = {
  requestId: string(name='RequestId'),
}

async function updateCustomLineWithOptions(request: UpdateCustomLineRequest, runtime: Util.RuntimeOptions): UpdateCustomLineResponse {
  Util.validateModel(request);
  return doRequest('UpdateCustomLine', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateCustomLine(request: UpdateCustomLineRequest): UpdateCustomLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomLineWithOptions(request, runtime);
}

model AddCustomLineRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  lineName: string(name='LineName'),
  ipSegment: [
    {
      startIp?: string(name='StartIp'),
      endIp?: string(name='EndIp'),
    }
  ](name='IpSegment'),
}

model AddCustomLineResponse = {
  requestId: string(name='RequestId'),
  lineId: long(name='LineId'),
  lineCode: string(name='LineCode'),
}

async function addCustomLineWithOptions(request: AddCustomLineRequest, runtime: Util.RuntimeOptions): AddCustomLineResponse {
  Util.validateModel(request);
  return doRequest('AddCustomLine', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addCustomLine(request: AddCustomLineRequest): AddCustomLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return addCustomLineWithOptions(request, runtime);
}

model DeleteCustomLinesRequest = {
  lang?: string(name='Lang'),
  lineIds: string(name='LineIds'),
}

model DeleteCustomLinesResponse = {
  requestId: string(name='RequestId'),
}

async function deleteCustomLinesWithOptions(request: DeleteCustomLinesRequest, runtime: Util.RuntimeOptions): DeleteCustomLinesResponse {
  Util.validateModel(request);
  return doRequest('DeleteCustomLines', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function deleteCustomLines(request: DeleteCustomLinesRequest): DeleteCustomLinesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomLinesWithOptions(request, runtime);
}

model DescribeCustomLineRequest = {
  lineId?: long(name='LineId'),
  lang?: string(name='Lang'),
}

model DescribeCustomLineResponse = {
  requestId: string(name='RequestId'),
  id: long(name='Id'),
  name: string(name='Name'),
  domainName: string(name='DomainName'),
  createTime: string(name='CreateTime'),
  createTimestamp: long(name='CreateTimestamp'),
  ipSegments: string(name='IpSegments'),
  code: string(name='Code'),
  ipSegmentList: [
    {
      name: string(name='Name'),
      startIp: string(name='StartIp'),
      endIp: string(name='EndIp'),
    }
  ](name='IpSegmentList'),
}

async function describeCustomLineWithOptions(request: DescribeCustomLineRequest, runtime: Util.RuntimeOptions): DescribeCustomLineResponse {
  Util.validateModel(request);
  return doRequest('DescribeCustomLine', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeCustomLine(request: DescribeCustomLineRequest): DescribeCustomLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomLineWithOptions(request, runtime);
}

model DescribeCustomLinesRequest = {
  lang?: string(name='Lang'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  domainName: string(name='DomainName'),
}

model DescribeCustomLinesResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
  totalPages: integer(name='TotalPages'),
  customLines: [
    {
      id: long(name='Id'),
      name: string(name='Name'),
      createTime: string(name='CreateTime'),
      createTimestamp: long(name='CreateTimestamp'),
      ipSegments: string(name='IpSegments'),
      code: string(name='Code'),
    }
  ](name='CustomLines'),
}

async function describeCustomLinesWithOptions(request: DescribeCustomLinesRequest, runtime: Util.RuntimeOptions): DescribeCustomLinesResponse {
  Util.validateModel(request);
  return doRequest('DescribeCustomLines', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeCustomLines(request: DescribeCustomLinesRequest): DescribeCustomLinesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomLinesWithOptions(request, runtime);
}

model DescribeDomainStatisticsSummaryRequest = {
  lang?: string(name='Lang'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  startDate: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  searchMode?: string(name='SearchMode'),
  keyword?: string(name='Keyword'),
  threshold?: long(name='Threshold'),
}

model DescribeDomainStatisticsSummaryResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageSize: integer(name='PageSize'),
  pageNumber: integer(name='PageNumber'),
  statistics: {
    statistic: [
      {
        domainName: string(name='DomainName'),
        count: long(name='Count'),
      }
    ](name='Statistic'),
  }(name='Statistics'),
}

async function describeDomainStatisticsSummaryWithOptions(request: DescribeDomainStatisticsSummaryRequest, runtime: Util.RuntimeOptions): DescribeDomainStatisticsSummaryResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainStatisticsSummary', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainStatisticsSummary(request: DescribeDomainStatisticsSummaryRequest): DescribeDomainStatisticsSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainStatisticsSummaryWithOptions(request, runtime);
}

model DescribeRecordStatisticsSummaryRequest = {
  lang?: string(name='Lang'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  startDate: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  domainName: string(name='DomainName'),
  searchMode?: string(name='SearchMode'),
  keyword?: string(name='Keyword'),
  threshold?: long(name='Threshold'),
}

model DescribeRecordStatisticsSummaryResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageSize: integer(name='PageSize'),
  pageNumber: integer(name='PageNumber'),
  statistics: {
    statistic: [
      {
        subDomain: string(name='SubDomain'),
        count: long(name='Count'),
      }
    ](name='Statistic'),
  }(name='Statistics'),
}

async function describeRecordStatisticsSummaryWithOptions(request: DescribeRecordStatisticsSummaryRequest, runtime: Util.RuntimeOptions): DescribeRecordStatisticsSummaryResponse {
  Util.validateModel(request);
  return doRequest('DescribeRecordStatisticsSummary', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeRecordStatisticsSummary(request: DescribeRecordStatisticsSummaryRequest): DescribeRecordStatisticsSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecordStatisticsSummaryWithOptions(request, runtime);
}

model OperateBatchDomainRequest = {
  lang?: string(name='Lang'),
  type: string(name='Type'),
  domainRecordInfo: [
    {
      domain: string(name='Domain'),
      type?: string(name='Type'),
      rr?: string(name='Rr'),
      value?: string(name='Value'),
      ttl?: integer(name='Ttl'),
      priority?: integer(name='Priority'),
      line?: string(name='Line'),
      newRr?: string(name='NewRr'),
      newType?: string(name='NewType'),
      newValue?: string(name='NewValue'),
    }
  ](name='DomainRecordInfo'),
}

model OperateBatchDomainResponse = {
  requestId: string(name='RequestId'),
  taskId: long(name='TaskId'),
}

async function operateBatchDomainWithOptions(request: OperateBatchDomainRequest, runtime: Util.RuntimeOptions): OperateBatchDomainResponse {
  Util.validateModel(request);
  return doRequest('OperateBatchDomain', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function operateBatchDomain(request: OperateBatchDomainRequest): OperateBatchDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return operateBatchDomainWithOptions(request, runtime);
}

model DescribeBatchResultDetailRequest = {
  lang?: string(name='Lang'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  taskId?: long(name='TaskId'),
  batchType?: string(name='BatchType'),
  status?: string(name='Status'),
}

model DescribeBatchResultDetailResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  batchResultDetails: {
    batchResultDetail: [
      {
        domain: string(name='Domain'),
        type: string(name='Type'),
        rr: string(name='Rr'),
        value: string(name='Value'),
        status: boolean(name='Status'),
        reason: string(name='Reason'),
        newRr: string(name='NewRr'),
        newValue: string(name='NewValue'),
        batchType: string(name='BatchType'),
        operateDateStr: string(name='OperateDateStr'),
        line: string(name='Line'),
        priority: string(name='Priority'),
        ttl: string(name='Ttl'),
        recordId: string(name='RecordId'),
        remark: string(name='Remark'),
        rrStatus: string(name='RrStatus'),
      }
    ](name='BatchResultDetail'),
  }(name='BatchResultDetails'),
}

async function describeBatchResultDetailWithOptions(request: DescribeBatchResultDetailRequest, runtime: Util.RuntimeOptions): DescribeBatchResultDetailResponse {
  Util.validateModel(request);
  return doRequest('DescribeBatchResultDetail', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeBatchResultDetail(request: DescribeBatchResultDetailRequest): DescribeBatchResultDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBatchResultDetailWithOptions(request, runtime);
}

model DescribeBatchResultCountRequest = {
  lang?: string(name='Lang'),
  taskId?: long(name='TaskId'),
  batchType?: string(name='BatchType'),
}

model DescribeBatchResultCountResponse = {
  requestId: string(name='RequestId'),
  status: integer(name='Status'),
  totalCount: integer(name='TotalCount'),
  successCount: integer(name='SuccessCount'),
  failedCount: integer(name='FailedCount'),
  reason: string(name='Reason'),
  batchType: string(name='BatchType'),
  taskId: long(name='TaskId'),
}

async function describeBatchResultCountWithOptions(request: DescribeBatchResultCountRequest, runtime: Util.RuntimeOptions): DescribeBatchResultCountResponse {
  Util.validateModel(request);
  return doRequest('DescribeBatchResultCount', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeBatchResultCount(request: DescribeBatchResultCountRequest): DescribeBatchResultCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBatchResultCountWithOptions(request, runtime);
}

model SetGtmAccessModeRequest = {
  lang?: string(name='Lang'),
  strategyId: string(name='StrategyId'),
  accessMode: string(name='AccessMode'),
}

model SetGtmAccessModeResponse = {
  requestId: string(name='RequestId'),
}

async function setGtmAccessModeWithOptions(request: SetGtmAccessModeRequest, runtime: Util.RuntimeOptions): SetGtmAccessModeResponse {
  Util.validateModel(request);
  return doRequest('SetGtmAccessMode', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function setGtmAccessMode(request: SetGtmAccessModeRequest): SetGtmAccessModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return setGtmAccessModeWithOptions(request, runtime);
}

model SetGtmMonitorStatusRequest = {
  lang?: string(name='Lang'),
  monitorConfigId: string(name='MonitorConfigId'),
  status: string(name='Status'),
}

model SetGtmMonitorStatusResponse = {
  requestId: string(name='RequestId'),
}

async function setGtmMonitorStatusWithOptions(request: SetGtmMonitorStatusRequest, runtime: Util.RuntimeOptions): SetGtmMonitorStatusResponse {
  Util.validateModel(request);
  return doRequest('SetGtmMonitorStatus', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function setGtmMonitorStatus(request: SetGtmMonitorStatusRequest): SetGtmMonitorStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setGtmMonitorStatusWithOptions(request, runtime);
}

model UpdateGtmInstanceGlobalConfigRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
  instanceName?: string(name='InstanceName'),
  ttl?: integer(name='Ttl'),
  userDomainName?: string(name='UserDomainName'),
  lbaStrategy?: string(name='LbaStrategy'),
  alertGroup?: string(name='AlertGroup'),
  cnameMode?: string(name='CnameMode'),
  cnameCustomDomainName?: string(name='CnameCustomDomainName'),
}

model UpdateGtmInstanceGlobalConfigResponse = {
  requestId: string(name='RequestId'),
}

async function updateGtmInstanceGlobalConfigWithOptions(request: UpdateGtmInstanceGlobalConfigRequest, runtime: Util.RuntimeOptions): UpdateGtmInstanceGlobalConfigResponse {
  Util.validateModel(request);
  return doRequest('UpdateGtmInstanceGlobalConfig', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateGtmInstanceGlobalConfig(request: UpdateGtmInstanceGlobalConfigRequest): UpdateGtmInstanceGlobalConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGtmInstanceGlobalConfigWithOptions(request, runtime);
}

model DescribeGtmLogsRequest = {
  lang?: string(name='Lang'),
  instanceId?: string(name='InstanceId'),
  keyword?: string(name='Keyword'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  startTimestamp?: long(name='StartTimestamp'),
  endTimestamp?: long(name='EndTimestamp'),
}

model DescribeGtmLogsResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageSize: integer(name='PageSize'),
  pageNumber: integer(name='PageNumber'),
  logs: {
    log: [
      {
        operTime: string(name='OperTime'),
        operAction: string(name='OperAction'),
        entityType: string(name='EntityType'),
        entityId: string(name='EntityId'),
        entityName: string(name='EntityName'),
        operIp: string(name='OperIp'),
        operTimestamp: long(name='OperTimestamp'),
        id: long(name='Id'),
        content: string(name='Content'),
      }
    ](name='Log'),
  }(name='Logs'),
}

async function describeGtmLogsWithOptions(request: DescribeGtmLogsRequest, runtime: Util.RuntimeOptions): DescribeGtmLogsResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmLogs', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmLogs(request: DescribeGtmLogsRequest): DescribeGtmLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmLogsWithOptions(request, runtime);
}

model DeleteGtmAccessStrategyRequest = {
  lang?: string(name='Lang'),
  strategyId?: string(name='StrategyId'),
}

model DeleteGtmAccessStrategyResponse = {
  requestId: string(name='RequestId'),
}

async function deleteGtmAccessStrategyWithOptions(request: DeleteGtmAccessStrategyRequest, runtime: Util.RuntimeOptions): DeleteGtmAccessStrategyResponse {
  Util.validateModel(request);
  return doRequest('DeleteGtmAccessStrategy', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function deleteGtmAccessStrategy(request: DeleteGtmAccessStrategyRequest): DeleteGtmAccessStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGtmAccessStrategyWithOptions(request, runtime);
}

model AddGtmMonitorRequest = {
  lang?: string(name='Lang'),
  addrPoolId: string(name='AddrPoolId'),
  protocolType: string(name='ProtocolType'),
  interval: integer(name='Interval'),
  evaluationCount: integer(name='EvaluationCount'),
  timeout: integer(name='Timeout'),
  monitorExtendInfo: string(name='MonitorExtendInfo'),
  ispCityNode: [
    {
      cityCode: string(name='CityCode'),
      ispCode: string(name='IspCode'),
    }
  ](name='IspCityNode'),
}

model AddGtmMonitorResponse = {
  requestId: string(name='RequestId'),
  monitorConfigId: string(name='MonitorConfigId'),
}

async function addGtmMonitorWithOptions(request: AddGtmMonitorRequest, runtime: Util.RuntimeOptions): AddGtmMonitorResponse {
  Util.validateModel(request);
  return doRequest('AddGtmMonitor', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addGtmMonitor(request: AddGtmMonitorRequest): AddGtmMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGtmMonitorWithOptions(request, runtime);
}

model AddGtmAddressPoolRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
  name: string(name='Name'),
  type: string(name='Type'),
  minAvailableAddrNum: integer(name='MinAvailableAddrNum'),
  addr: [
    {
      value: string(name='Value'),
      lbaWeight: integer(name='LbaWeight'),
      mode: string(name='Mode'),
    }
  ](name='Addr'),
  monitorStatus?: string(name='MonitorStatus'),
  protocolType?: string(name='ProtocolType'),
  interval?: integer(name='Interval'),
  evaluationCount?: integer(name='EvaluationCount'),
  timeout?: integer(name='Timeout'),
  monitorExtendInfo?: string(name='MonitorExtendInfo'),
  ispCityNode?: [
    {
      cityCode?: string(name='CityCode'),
      ispCode?: string(name='IspCode'),
    }
  ](name='IspCityNode'),
}

model AddGtmAddressPoolResponse = {
  requestId: string(name='RequestId'),
  addrPoolId: string(name='AddrPoolId'),
  monitorConfigId: string(name='MonitorConfigId'),
}

async function addGtmAddressPoolWithOptions(request: AddGtmAddressPoolRequest, runtime: Util.RuntimeOptions): AddGtmAddressPoolResponse {
  Util.validateModel(request);
  return doRequest('AddGtmAddressPool', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addGtmAddressPool(request: AddGtmAddressPoolRequest): AddGtmAddressPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGtmAddressPoolWithOptions(request, runtime);
}

model AddGtmAccessStrategyRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
  strategyName: string(name='StrategyName'),
  defaultAddrPoolId: string(name='DefaultAddrPoolId'),
  failoverAddrPoolId: string(name='FailoverAddrPoolId'),
  accessLines: string(name='AccessLines'),
}

model AddGtmAccessStrategyResponse = {
  requestId: string(name='RequestId'),
  strategyId: string(name='StrategyId'),
}

async function addGtmAccessStrategyWithOptions(request: AddGtmAccessStrategyRequest, runtime: Util.RuntimeOptions): AddGtmAccessStrategyResponse {
  Util.validateModel(request);
  return doRequest('AddGtmAccessStrategy', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addGtmAccessStrategy(request: AddGtmAccessStrategyRequest): AddGtmAccessStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGtmAccessStrategyWithOptions(request, runtime);
}

model DescribeGtmInstancesRequest = {
  lang?: string(name='Lang'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
  keyword?: string(name='Keyword'),
  resourceGroupId?: string(name='ResourceGroupId'),
  needDetailAttributes?: boolean(name='NeedDetailAttributes'),
}

model DescribeGtmInstancesResponse = {
  requestId: string(name='RequestId'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  gtmInstances: {
    gtmInstance: [
      {
        instanceId: string(name='InstanceId'),
        instanceName: string(name='InstanceName'),
        cname: string(name='Cname'),
        userDomainName: string(name='UserDomainName'),
        versionCode: string(name='VersionCode'),
        ttl: integer(name='Ttl'),
        lbaStrategy: string(name='LbaStrategy'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        expireTime: string(name='ExpireTime'),
        expireTimestamp: long(name='ExpireTimestamp'),
        alertGroup: string(name='AlertGroup'),
        cnameMode: string(name='CnameMode'),
        accessStrategyNum: integer(name='AccessStrategyNum'),
        addressPoolNum: integer(name='AddressPoolNum'),
      }
    ](name='GtmInstance'),
  }(name='GtmInstances'),
}

async function describeGtmInstancesWithOptions(request: DescribeGtmInstancesRequest, runtime: Util.RuntimeOptions): DescribeGtmInstancesResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmInstances', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmInstances(request: DescribeGtmInstancesRequest): DescribeGtmInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmInstancesWithOptions(request, runtime);
}

model DeleteGtmAddressPoolRequest = {
  lang?: string(name='Lang'),
  addrPoolId: string(name='AddrPoolId'),
}

model DeleteGtmAddressPoolResponse = {
  requestId: string(name='RequestId'),
}

async function deleteGtmAddressPoolWithOptions(request: DeleteGtmAddressPoolRequest, runtime: Util.RuntimeOptions): DeleteGtmAddressPoolResponse {
  Util.validateModel(request);
  return doRequest('DeleteGtmAddressPool', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function deleteGtmAddressPool(request: DeleteGtmAddressPoolRequest): DeleteGtmAddressPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGtmAddressPoolWithOptions(request, runtime);
}

model DescribeGtmAccessStrategiesRequest = {
  lang?: string(name='Lang'),
  instanceId?: string(name='InstanceId'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
}

model DescribeGtmAccessStrategiesResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
  strategies: {
    strategy: [
      {
        strategyId: string(name='StrategyId'),
        strategyName: string(name='StrategyName'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        defaultAddrPoolId: string(name='DefaultAddrPoolId'),
        defaultAddrPoolName: string(name='DefaultAddrPoolName'),
        failoverAddrPoolId: string(name='FailoverAddrPoolId'),
        failoverAddrPoolName: string(name='FailoverAddrPoolName'),
        accessMode: string(name='AccessMode'),
        accessStatus: string(name='AccessStatus'),
        strategyMode: string(name='StrategyMode'),
        instanceId: string(name='InstanceId'),
        defaultAddrPoolStatus: string(name='DefaultAddrPoolStatus'),
        failoverAddrPoolStatus: string(name='FailoverAddrPoolStatus'),
        defaultAddrPoolMonitorStatus: string(name='DefaultAddrPoolMonitorStatus'),
        failoverAddrPoolMonitorStatus: string(name='FailoverAddrPoolMonitorStatus'),
        lines: {
          line: [
            {
              lineCode: string(name='LineCode'),
              lineName: string(name='LineName'),
              groupCode: string(name='GroupCode'),
              groupName: string(name='GroupName'),
            }
          ](name='Line'),
        }(name='Lines'),
      }
    ](name='Strategy'),
  }(name='Strategies'),
}

async function describeGtmAccessStrategiesWithOptions(request: DescribeGtmAccessStrategiesRequest, runtime: Util.RuntimeOptions): DescribeGtmAccessStrategiesResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmAccessStrategies', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmAccessStrategies(request: DescribeGtmAccessStrategiesRequest): DescribeGtmAccessStrategiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmAccessStrategiesWithOptions(request, runtime);
}

model DescribeGtmAccessStrategyRequest = {
  lang?: string(name='Lang'),
  strategyId: string(name='StrategyId'),
}

model DescribeGtmAccessStrategyResponse = {
  requestId: string(name='RequestId'),
  strategyId: string(name='StrategyId'),
  strategyName: string(name='StrategyName'),
  defultAddrPoolId: string(name='DefultAddrPoolId'),
  defaultAddrPoolName: string(name='DefaultAddrPoolName'),
  failoverAddrPoolId: string(name='FailoverAddrPoolId'),
  failoverAddrPoolName: string(name='FailoverAddrPoolName'),
  strategyMode: string(name='StrategyMode'),
  accessMode: string(name='AccessMode'),
  accessStatus: string(name='AccessStatus'),
  instanceId: string(name='InstanceId'),
  defaultAddrPoolStatus: string(name='DefaultAddrPoolStatus'),
  failoverAddrPoolStatus: string(name='FailoverAddrPoolStatus'),
  defaultAddrPoolMonitorStatus: string(name='DefaultAddrPoolMonitorStatus'),
  failoverAddrPoolMonitorStatus: string(name='FailoverAddrPoolMonitorStatus'),
  lines: {
    line: [
      {
        lineCode: string(name='LineCode'),
        lineName: string(name='LineName'),
        groupCode: string(name='GroupCode'),
        groupName: string(name='GroupName'),
      }
    ](name='Line'),
  }(name='Lines'),
}

async function describeGtmAccessStrategyWithOptions(request: DescribeGtmAccessStrategyRequest, runtime: Util.RuntimeOptions): DescribeGtmAccessStrategyResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmAccessStrategy', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmAccessStrategy(request: DescribeGtmAccessStrategyRequest): DescribeGtmAccessStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmAccessStrategyWithOptions(request, runtime);
}

model DescribeGtmAccessStrategyAvailableConfigRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
}

model DescribeGtmAccessStrategyAvailableConfigResponse = {
  requestId: string(name='RequestId'),
  addrPools: {
    addrPool: [
      {
        addrPoolId: string(name='AddrPoolId'),
        addrPoolName: string(name='AddrPoolName'),
      }
    ](name='AddrPool'),
  }(name='AddrPools'),
  lines: {
    line: [
      {
        lineCode: string(name='LineCode'),
        lineName: string(name='LineName'),
        groupCode: string(name='GroupCode'),
        groupName: string(name='GroupName'),
        status: string(name='Status'),
        fatherCode: string(name='FatherCode'),
      }
    ](name='Line'),
  }(name='Lines'),
}

async function describeGtmAccessStrategyAvailableConfigWithOptions(request: DescribeGtmAccessStrategyAvailableConfigRequest, runtime: Util.RuntimeOptions): DescribeGtmAccessStrategyAvailableConfigResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmAccessStrategyAvailableConfig', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmAccessStrategyAvailableConfig(request: DescribeGtmAccessStrategyAvailableConfigRequest): DescribeGtmAccessStrategyAvailableConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmAccessStrategyAvailableConfigWithOptions(request, runtime);
}

model DescribeGtmAvailableAlertGroupRequest = {
  lang?: string(name='Lang'),
}

model DescribeGtmAvailableAlertGroupResponse = {
  requestId: string(name='RequestId'),
  availableAlertGroup: string(name='AvailableAlertGroup'),
}

async function describeGtmAvailableAlertGroupWithOptions(request: DescribeGtmAvailableAlertGroupRequest, runtime: Util.RuntimeOptions): DescribeGtmAvailableAlertGroupResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmAvailableAlertGroup', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmAvailableAlertGroup(request: DescribeGtmAvailableAlertGroupRequest): DescribeGtmAvailableAlertGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmAvailableAlertGroupWithOptions(request, runtime);
}

model DescribeGtmInstanceRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
  needDetailAttributes?: boolean(name='NeedDetailAttributes'),
}

model DescribeGtmInstanceResponse = {
  requestId: string(name='RequestId'),
  instanceId: string(name='InstanceId'),
  instanceName: string(name='InstanceName'),
  versionCode: string(name='VersionCode'),
  expireTime: string(name='ExpireTime'),
  expireTimestamp: long(name='ExpireTimestamp'),
  cname: string(name='Cname'),
  userDomainName: string(name='UserDomainName'),
  ttl: integer(name='Ttl'),
  lbaStrategy: string(name='LbaStrategy'),
  createTime: string(name='CreateTime'),
  createTimestamp: long(name='CreateTimestamp'),
  alertGroup: string(name='AlertGroup'),
  cnameMode: string(name='CnameMode'),
  accessStrategyNum: integer(name='AccessStrategyNum'),
  addressPoolNum: integer(name='AddressPoolNum'),
}

async function describeGtmInstanceWithOptions(request: DescribeGtmInstanceRequest, runtime: Util.RuntimeOptions): DescribeGtmInstanceResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmInstance', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmInstance(request: DescribeGtmInstanceRequest): DescribeGtmInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmInstanceWithOptions(request, runtime);
}

model DescribeGtmInstanceAddressPoolRequest = {
  lang?: string(name='Lang'),
  addrPoolId: string(name='AddrPoolId'),
}

model DescribeGtmInstanceAddressPoolResponse = {
  requestId: string(name='RequestId'),
  addrPoolId: string(name='AddrPoolId'),
  createTime: string(name='CreateTime'),
  createTimestamp: long(name='CreateTimestamp'),
  updateTime: string(name='UpdateTime'),
  updateTimestamp: long(name='UpdateTimestamp'),
  addrCount: integer(name='AddrCount'),
  minAvailableAddrNum: integer(name='MinAvailableAddrNum'),
  monitorConfigId: string(name='MonitorConfigId'),
  monitorStatus: string(name='MonitorStatus'),
  name: string(name='Name'),
  status: string(name='Status'),
  type: string(name='Type'),
  addrs: {
    addr: [
      {
        addrId: long(name='AddrId'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        updateTime: string(name='UpdateTime'),
        updateTimestamp: long(name='UpdateTimestamp'),
        value: string(name='Value'),
        lbaWeight: integer(name='LbaWeight'),
        mode: string(name='Mode'),
        alertStatus: string(name='AlertStatus'),
      }
    ](name='Addr'),
  }(name='Addrs'),
}

async function describeGtmInstanceAddressPoolWithOptions(request: DescribeGtmInstanceAddressPoolRequest, runtime: Util.RuntimeOptions): DescribeGtmInstanceAddressPoolResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmInstanceAddressPool', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmInstanceAddressPool(request: DescribeGtmInstanceAddressPoolRequest): DescribeGtmInstanceAddressPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmInstanceAddressPoolWithOptions(request, runtime);
}

model DescribeGtmInstanceAddressPoolsRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
  pageNumber?: integer(name='PageNumber'),
  pageSize?: integer(name='PageSize'),
}

model DescribeGtmInstanceAddressPoolsResponse = {
  requestId: string(name='RequestId'),
  totalItems: integer(name='TotalItems'),
  totalPages: integer(name='TotalPages'),
  pageNumber: integer(name='PageNumber'),
  pageSize: integer(name='PageSize'),
  addrPools: {
    addrPool: [
      {
        addrPoolId: string(name='AddrPoolId'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        updateTime: string(name='UpdateTime'),
        updateTimestamp: long(name='UpdateTimestamp'),
        addrCount: integer(name='AddrCount'),
        minAvailableAddrNum: integer(name='MinAvailableAddrNum'),
        monitorConfigId: string(name='MonitorConfigId'),
        monitorStatus: string(name='MonitorStatus'),
        name: string(name='Name'),
        status: string(name='Status'),
        type: string(name='Type'),
      }
    ](name='AddrPool'),
  }(name='AddrPools'),
}

async function describeGtmInstanceAddressPoolsWithOptions(request: DescribeGtmInstanceAddressPoolsRequest, runtime: Util.RuntimeOptions): DescribeGtmInstanceAddressPoolsResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmInstanceAddressPools', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmInstanceAddressPools(request: DescribeGtmInstanceAddressPoolsRequest): DescribeGtmInstanceAddressPoolsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmInstanceAddressPoolsWithOptions(request, runtime);
}

model DescribeGtmInstanceStatusRequest = {
  lang?: string(name='Lang'),
  instanceId: string(name='InstanceId'),
}

model DescribeGtmInstanceStatusResponse = {
  requestId: string(name='RequestId'),
  addrNotAvailableNum: integer(name='AddrNotAvailableNum'),
  addrPoolNotAvailableNum: integer(name='AddrPoolNotAvailableNum'),
  switchToFailoverStrategyNum: integer(name='SwitchToFailoverStrategyNum'),
  strategyNotAvailableNum: integer(name='StrategyNotAvailableNum'),
  status: string(name='Status'),
  statusReason: string(name='StatusReason'),
}

async function describeGtmInstanceStatusWithOptions(request: DescribeGtmInstanceStatusRequest, runtime: Util.RuntimeOptions): DescribeGtmInstanceStatusResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmInstanceStatus', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmInstanceStatus(request: DescribeGtmInstanceStatusRequest): DescribeGtmInstanceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmInstanceStatusWithOptions(request, runtime);
}

model DescribeGtmMonitorAvailableConfigRequest = {
  lang?: string(name='Lang'),
}

model DescribeGtmMonitorAvailableConfigResponse = {
  requestId: string(name='RequestId'),
  ispCityNodes: {
    ispCityNode: [
      {
        ispName: string(name='IspName'),
        ispCode: string(name='IspCode'),
        cityName: string(name='CityName'),
        cityCode: string(name='CityCode'),
        defaultSelected: boolean(name='DefaultSelected'),
        mainland: boolean(name='Mainland'),
        groupType: string(name='GroupType'),
        groupName: string(name='GroupName'),
      }
    ](name='IspCityNode'),
  }(name='IspCityNodes'),
}

async function describeGtmMonitorAvailableConfigWithOptions(request: DescribeGtmMonitorAvailableConfigRequest, runtime: Util.RuntimeOptions): DescribeGtmMonitorAvailableConfigResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmMonitorAvailableConfig', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmMonitorAvailableConfig(request: DescribeGtmMonitorAvailableConfigRequest): DescribeGtmMonitorAvailableConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmMonitorAvailableConfigWithOptions(request, runtime);
}

model DescribeGtmMonitorConfigRequest = {
  lang?: string(name='Lang'),
  monitorConfigId: string(name='MonitorConfigId'),
}

model DescribeGtmMonitorConfigResponse = {
  requestId: string(name='RequestId'),
  monitorConfigId: string(name='MonitorConfigId'),
  createTime: string(name='CreateTime'),
  createTimestamp: long(name='CreateTimestamp'),
  updateTime: string(name='UpdateTime'),
  updateTimestamp: long(name='UpdateTimestamp'),
  protocolType: string(name='ProtocolType'),
  interval: integer(name='Interval'),
  evaluationCount: integer(name='EvaluationCount'),
  timeout: integer(name='Timeout'),
  monitorExtendInfo: string(name='MonitorExtendInfo'),
  ispCityNodes: {
    ispCityNode: [
      {
        countryName: string(name='CountryName'),
        countryCode: string(name='CountryCode'),
        cityName: string(name='CityName'),
        cityCode: string(name='CityCode'),
        ispCode: string(name='IspCode'),
        ispName: string(name='IspName'),
      }
    ](name='IspCityNode'),
  }(name='IspCityNodes'),
}

async function describeGtmMonitorConfigWithOptions(request: DescribeGtmMonitorConfigRequest, runtime: Util.RuntimeOptions): DescribeGtmMonitorConfigResponse {
  Util.validateModel(request);
  return doRequest('DescribeGtmMonitorConfig', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeGtmMonitorConfig(request: DescribeGtmMonitorConfigRequest): DescribeGtmMonitorConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGtmMonitorConfigWithOptions(request, runtime);
}

model UpdateGtmAccessStrategyRequest = {
  lang?: string(name='Lang'),
  strategyId: string(name='StrategyId'),
  strategyName?: string(name='StrategyName'),
  defaultAddrPoolId?: string(name='DefaultAddrPoolId'),
  failoverAddrPoolId?: string(name='FailoverAddrPoolId'),
  accessLines?: string(name='AccessLines'),
}

model UpdateGtmAccessStrategyResponse = {
  requestId: string(name='RequestId'),
}

async function updateGtmAccessStrategyWithOptions(request: UpdateGtmAccessStrategyRequest, runtime: Util.RuntimeOptions): UpdateGtmAccessStrategyResponse {
  Util.validateModel(request);
  return doRequest('UpdateGtmAccessStrategy', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateGtmAccessStrategy(request: UpdateGtmAccessStrategyRequest): UpdateGtmAccessStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGtmAccessStrategyWithOptions(request, runtime);
}

model UpdateGtmAddressPoolRequest = {
  lang?: string(name='Lang'),
  addrPoolId: string(name='AddrPoolId'),
  name?: string(name='Name'),
  type: string(name='Type'),
  minAvailableAddrNum?: integer(name='MinAvailableAddrNum'),
  addr: [
    {
      value: string(name='Value'),
      lbaWeight: integer(name='LbaWeight'),
      mode: string(name='Mode'),
    }
  ](name='Addr'),
}

model UpdateGtmAddressPoolResponse = {
  requestId: string(name='RequestId'),
}

async function updateGtmAddressPoolWithOptions(request: UpdateGtmAddressPoolRequest, runtime: Util.RuntimeOptions): UpdateGtmAddressPoolResponse {
  Util.validateModel(request);
  return doRequest('UpdateGtmAddressPool', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateGtmAddressPool(request: UpdateGtmAddressPoolRequest): UpdateGtmAddressPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGtmAddressPoolWithOptions(request, runtime);
}

model UpdateGtmMonitorRequest = {
  lang?: string(name='Lang'),
  monitorConfigId: string(name='MonitorConfigId'),
  protocolType: string(name='ProtocolType'),
  interval?: integer(name='Interval'),
  evaluationCount?: integer(name='EvaluationCount'),
  timeout?: integer(name='Timeout'),
  monitorExtendInfo: string(name='MonitorExtendInfo'),
  ispCityNode: [
    {
      cityCode: string(name='CityCode'),
      ispCode: string(name='IspCode'),
    }
  ](name='IspCityNode'),
}

model UpdateGtmMonitorResponse = {
  requestId: string(name='RequestId'),
}

async function updateGtmMonitorWithOptions(request: UpdateGtmMonitorRequest, runtime: Util.RuntimeOptions): UpdateGtmMonitorResponse {
  Util.validateModel(request);
  return doRequest('UpdateGtmMonitor', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateGtmMonitor(request: UpdateGtmMonitorRequest): UpdateGtmMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGtmMonitorWithOptions(request, runtime);
}

model UpdateDomainRemarkRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  remark?: string(name='Remark'),
}

model UpdateDomainRemarkResponse = {
  requestId: string(name='RequestId'),
}

async function updateDomainRemarkWithOptions(request: UpdateDomainRemarkRequest, runtime: Util.RuntimeOptions): UpdateDomainRemarkResponse {
  Util.validateModel(request);
  return doRequest('UpdateDomainRemark', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateDomainRemark(request: UpdateDomainRemarkRequest): UpdateDomainRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDomainRemarkWithOptions(request, runtime);
}

model UpdateDomainRecordRemarkRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  recordId: string(name='RecordId'),
  remark?: string(name='Remark'),
}

model UpdateDomainRecordRemarkResponse = {
  requestId: string(name='RequestId'),
}

async function updateDomainRecordRemarkWithOptions(request: UpdateDomainRecordRemarkRequest, runtime: Util.RuntimeOptions): UpdateDomainRecordRemarkResponse {
  Util.validateModel(request);
  return doRequest('UpdateDomainRecordRemark', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateDomainRecordRemark(request: UpdateDomainRecordRemarkRequest): UpdateDomainRecordRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDomainRecordRemarkWithOptions(request, runtime);
}

model DescribeSupportLinesRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  domainName?: string(name='DomainName'),
}

model DescribeSupportLinesResponse = {
  requestId: string(name='RequestId'),
  recordLines: {
    recordLine: [
      {
        lineCode: string(name='LineCode'),
        fatherCode: string(name='FatherCode'),
        lineName: string(name='LineName'),
        lineDisplayName: string(name='LineDisplayName'),
      }
    ](name='RecordLine'),
  }(name='RecordLines'),
}

async function describeSupportLinesWithOptions(request: DescribeSupportLinesRequest, runtime: Util.RuntimeOptions): DescribeSupportLinesResponse {
  Util.validateModel(request);
  return doRequest('DescribeSupportLines', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeSupportLines(request: DescribeSupportLinesRequest): DescribeSupportLinesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSupportLinesWithOptions(request, runtime);
}

model DescribeDomainNsRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
}

model DescribeDomainNsResponse = {
  requestId: string(name='RequestId'),
  allAliDns: boolean(name='AllAliDns'),
  includeAliDns: boolean(name='IncludeAliDns'),
  dnsServers: {
    dnsServer: [ string ](name='DnsServer'),
  }(name='DnsServers'),
  expectDnsServers: {
    expectDnsServer: [ string ](name='ExpectDnsServer'),
  }(name='ExpectDnsServers'),
}

async function describeDomainNsWithOptions(request: DescribeDomainNsRequest, runtime: Util.RuntimeOptions): DescribeDomainNsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainNs', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainNs(request: DescribeDomainNsRequest): DescribeDomainNsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainNsWithOptions(request, runtime);
}

model DescribeDnsProductInstanceRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  instanceId: string(name='InstanceId'),
}

model DescribeDnsProductInstanceResponse = {
  requestId: string(name='RequestId'),
  instanceId: string(name='InstanceId'),
  versionCode: string(name='VersionCode'),
  versionName: string(name='VersionName'),
  startTime: string(name='StartTime'),
  startTimestamp: long(name='StartTimestamp'),
  endTime: string(name='EndTime'),
  endTimestamp: long(name='EndTimestamp'),
  domain: string(name='Domain'),
  bindCount: long(name='BindCount'),
  bindUsedCount: long(name='BindUsedCount'),
  TTLMinValue: long(name='TTLMinValue'),
  subDomainLevel: long(name='SubDomainLevel'),
  dnsSLBCount: long(name='DnsSLBCount'),
  URLForwardCount: long(name='URLForwardCount'),
  DDosDefendFlow: long(name='DDosDefendFlow'),
  DDosDefendQuery: long(name='DDosDefendQuery'),
  overseaDDosDefendFlow: long(name='OverseaDDosDefendFlow'),
  searchEngineLines: string(name='SearchEngineLines'),
  ISPLines: string(name='ISPLines'),
  ISPRegionLines: string(name='ISPRegionLines'),
  overseaLine: string(name='OverseaLine'),
  monitorNodeCount: long(name='MonitorNodeCount'),
  monitorFrequency: long(name='MonitorFrequency'),
  monitorTaskCount: long(name='MonitorTaskCount'),
  regionLines: boolean(name='RegionLines'),
  gslb: boolean(name='Gslb'),
  inClean: boolean(name='InClean'),
  inBlackHole: boolean(name='InBlackHole'),
  bindDomainCount: long(name='BindDomainCount'),
  bindDomainUsedCount: long(name='BindDomainUsedCount'),
  dnsSecurity: string(name='DnsSecurity'),
  dnsServers: {
    dnsServer: [ string ](name='DnsServer'),
  }(name='DnsServers'),
}

async function describeDnsProductInstanceWithOptions(request: DescribeDnsProductInstanceRequest, runtime: Util.RuntimeOptions): DescribeDnsProductInstanceResponse {
  Util.validateModel(request);
  return doRequest('DescribeDnsProductInstance', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDnsProductInstance(request: DescribeDnsProductInstanceRequest): DescribeDnsProductInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDnsProductInstanceWithOptions(request, runtime);
}

model UpdateDomainRecordRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  recordId: string(name='RecordId'),
  RR: string(name='RR'),
  type: string(name='Type'),
  value: string(name='Value'),
  TTL?: long(name='TTL'),
  priority?: long(name='Priority'),
  line?: string(name='Line'),
}

model UpdateDomainRecordResponse = {
  requestId: string(name='RequestId'),
  recordId: string(name='RecordId'),
}

async function updateDomainRecordWithOptions(request: UpdateDomainRecordRequest, runtime: Util.RuntimeOptions): UpdateDomainRecordResponse {
  Util.validateModel(request);
  return doRequest('UpdateDomainRecord', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function updateDomainRecord(request: UpdateDomainRecordRequest): UpdateDomainRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDomainRecordWithOptions(request, runtime);
}

model UpdateDomainGroupRequest = {
  lang?: string(name='Lang'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
}

model UpdateDomainGroupResponse = {
  requestId: string(name='RequestId'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
}

async function updateDomainGroupWithOptions(request: UpdateDomainGroupRequest, runtime: Util.RuntimeOptions): UpdateDomainGroupResponse {
  Util.validateModel(request);
  return doRequest('UpdateDomainGroup', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateDomainGroup(request: UpdateDomainGroupRequest): UpdateDomainGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDomainGroupWithOptions(request, runtime);
}

model UpdateDNSSLBWeightRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  recordId: string(name='RecordId'),
  weight: integer(name='Weight'),
}

model UpdateDNSSLBWeightResponse = {
  requestId: string(name='RequestId'),
  recordId: string(name='RecordId'),
  weight: integer(name='Weight'),
}

async function updateDNSSLBWeightWithOptions(request: UpdateDNSSLBWeightRequest, runtime: Util.RuntimeOptions): UpdateDNSSLBWeightResponse {
  Util.validateModel(request);
  return doRequest('UpdateDNSSLBWeight', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function updateDNSSLBWeight(request: UpdateDNSSLBWeightRequest): UpdateDNSSLBWeightResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDNSSLBWeightWithOptions(request, runtime);
}

model SetDomainRecordStatusRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  recordId: string(name='RecordId'),
  status: string(name='Status'),
}

model SetDomainRecordStatusResponse = {
  requestId: string(name='RequestId'),
  recordId: string(name='RecordId'),
  status: string(name='Status'),
}

async function setDomainRecordStatusWithOptions(request: SetDomainRecordStatusRequest, runtime: Util.RuntimeOptions): SetDomainRecordStatusResponse {
  Util.validateModel(request);
  return doRequest('SetDomainRecordStatus', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function setDomainRecordStatus(request: SetDomainRecordStatusRequest): SetDomainRecordStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDomainRecordStatusWithOptions(request, runtime);
}

model SetDNSSLBStatusRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  subDomain: string(name='SubDomain'),
  open?: boolean(name='Open'),
  domainName?: string(name='DomainName'),
  type?: string(name='Type'),
}

model SetDNSSLBStatusResponse = {
  requestId: string(name='RequestId'),
  recordCount: long(name='RecordCount'),
  open: boolean(name='Open'),
}

async function setDNSSLBStatusWithOptions(request: SetDNSSLBStatusRequest, runtime: Util.RuntimeOptions): SetDNSSLBStatusResponse {
  Util.validateModel(request);
  return doRequest('SetDNSSLBStatus', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function setDNSSLBStatus(request: SetDNSSLBStatusRequest): SetDNSSLBStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDNSSLBStatusWithOptions(request, runtime);
}

model ModifyHichinaDomainDNSRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  domainName: string(name='DomainName'),
}

model ModifyHichinaDomainDNSResponse = {
  requestId: string(name='RequestId'),
  originalDnsServers: {
    dnsServer: [ string ](name='DnsServer'),
  }(name='OriginalDnsServers'),
  newDnsServers: {
    dnsServer: [ string ](name='DnsServer'),
  }(name='NewDnsServers'),
}

async function modifyHichinaDomainDNSWithOptions(request: ModifyHichinaDomainDNSRequest, runtime: Util.RuntimeOptions): ModifyHichinaDomainDNSResponse {
  Util.validateModel(request);
  return doRequest('ModifyHichinaDomainDNS', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function modifyHichinaDomainDNS(request: ModifyHichinaDomainDNSRequest): ModifyHichinaDomainDNSResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHichinaDomainDNSWithOptions(request, runtime);
}

model GetMainDomainNameRequest = {
  lang?: string(name='Lang'),
  inputString: string(name='InputString'),
}

model GetMainDomainNameResponse = {
  requestId: string(name='RequestId'),
  domainName: string(name='DomainName'),
  RR: string(name='RR'),
  domainLevel: long(name='DomainLevel'),
}

async function getMainDomainNameWithOptions(request: GetMainDomainNameRequest, runtime: Util.RuntimeOptions): GetMainDomainNameResponse {
  Util.validateModel(request);
  return doRequest('GetMainDomainName', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function getMainDomainName(request: GetMainDomainNameRequest): GetMainDomainNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMainDomainNameWithOptions(request, runtime);
}

model DescribeSubDomainRecordsRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  subDomain: string(name='SubDomain'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  type?: string(name='Type'),
  line?: string(name='Line'),
  domainName?: string(name='DomainName'),
}

model DescribeSubDomainRecordsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  domainRecords: {
    record: [
      {
        domainName: string(name='DomainName'),
        recordId: string(name='RecordId'),
        RR: string(name='RR'),
        type: string(name='Type'),
        value: string(name='Value'),
        TTL: long(name='TTL'),
        priority: long(name='Priority'),
        line: string(name='Line'),
        status: string(name='Status'),
        locked: boolean(name='Locked'),
        weight: integer(name='Weight'),
      }
    ](name='Record'),
  }(name='DomainRecords'),
}

async function describeSubDomainRecordsWithOptions(request: DescribeSubDomainRecordsRequest, runtime: Util.RuntimeOptions): DescribeSubDomainRecordsResponse {
  Util.validateModel(request);
  return doRequest('DescribeSubDomainRecords', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeSubDomainRecords(request: DescribeSubDomainRecordsRequest): DescribeSubDomainRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSubDomainRecordsWithOptions(request, runtime);
}

model DescribeRecordLogsRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  domainName: string(name='DomainName'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  keyWord?: string(name='KeyWord'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='endDate'),
}

model DescribeRecordLogsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  recordLogs: {
    recordLog: [
      {
        actionTime: string(name='ActionTime'),
        actionTimestamp: long(name='ActionTimestamp'),
        action: string(name='Action'),
        message: string(name='Message'),
        clientIp: string(name='ClientIp'),
      }
    ](name='RecordLog'),
  }(name='RecordLogs'),
}

async function describeRecordLogsWithOptions(request: DescribeRecordLogsRequest, runtime: Util.RuntimeOptions): DescribeRecordLogsResponse {
  Util.validateModel(request);
  return doRequest('DescribeRecordLogs', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeRecordLogs(request: DescribeRecordLogsRequest): DescribeRecordLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecordLogsWithOptions(request, runtime);
}

model DescribeDomainsRequest = {
  lang?: string(name='Lang'),
  keyWord?: string(name='KeyWord'),
  groupId?: string(name='GroupId'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  searchMode?: string(name='SearchMode'),
  resourceGroupId?: string(name='ResourceGroupId'),
  starmark?: boolean(name='Starmark'),
}

model DescribeDomainsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  domains: {
    domain: [
      {
        domainId: string(name='DomainId'),
        domainName: string(name='DomainName'),
        punyCode: string(name='PunyCode'),
        aliDomain: boolean(name='AliDomain'),
        recordCount: long(name='RecordCount'),
        registrantEmail: string(name='RegistrantEmail'),
        remark: string(name='Remark'),
        groupId: string(name='GroupId'),
        groupName: string(name='GroupName'),
        instanceId: string(name='InstanceId'),
        versionCode: string(name='VersionCode'),
        versionName: string(name='VersionName'),
        instanceEndTime: string(name='InstanceEndTime'),
        instanceExpired: boolean(name='InstanceExpired'),
        starmark: boolean(name='Starmark'),
        createTime: string(name='CreateTime'),
        createTimestamp: long(name='CreateTimestamp'),
        resourceGroupId: string(name='ResourceGroupId'),
        tags: {
          tag: [
            {
              key: string(name='Key'),
              value: string(name='Value'),
            }
          ](name='Tag'),
        }(name='Tags'),
        dnsServers: {
          dnsServer: [ string ](name='DnsServer', description='DnsServer'),
        }(name='DnsServers'),
      }
    ](name='Domain'),
  }(name='Domains'),
}

async function describeDomainsWithOptions(request: DescribeDomainsRequest, runtime: Util.RuntimeOptions): DescribeDomainsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomains', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function describeDomains(request: DescribeDomainsRequest): DescribeDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainsWithOptions(request, runtime);
}

model DescribeDomainRecordsRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  keyWord?: string(name='KeyWord'),
  RRKeyWord?: string(name='RRKeyWord'),
  typeKeyWord?: string(name='TypeKeyWord'),
  valueKeyWord?: string(name='ValueKeyWord'),
  orderBy?: string(name='OrderBy'),
  direction?: string(name='Direction'),
  searchMode?: string(name='SearchMode'),
  groupId?: long(name='GroupId'),
  type?: string(name='Type'),
  line?: string(name='Line'),
  status?: string(name='Status'),
}

model DescribeDomainRecordsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  domainRecords: {
    record: [
      {
        domainName: string(name='DomainName'),
        recordId: string(name='RecordId'),
        RR: string(name='RR'),
        type: string(name='Type'),
        value: string(name='Value'),
        TTL: long(name='TTL'),
        priority: long(name='Priority'),
        line: string(name='Line'),
        status: string(name='Status'),
        locked: boolean(name='Locked'),
        weight: integer(name='Weight'),
        remark: string(name='Remark'),
      }
    ](name='Record'),
  }(name='DomainRecords'),
}

async function describeDomainRecordsWithOptions(request: DescribeDomainRecordsRequest, runtime: Util.RuntimeOptions): DescribeDomainRecordsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainRecords', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function describeDomainRecords(request: DescribeDomainRecordsRequest): DescribeDomainRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainRecordsWithOptions(request, runtime);
}

model DescribeDomainRecordInfoRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  recordId: string(name='RecordId'),
}

model DescribeDomainRecordInfoResponse = {
  requestId: string(name='RequestId'),
  domainId: string(name='DomainId'),
  domainName: string(name='DomainName'),
  punyCode: string(name='PunyCode'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
  recordId: string(name='RecordId'),
  RR: string(name='RR'),
  type: string(name='Type'),
  value: string(name='Value'),
  TTL: long(name='TTL'),
  priority: long(name='Priority'),
  line: string(name='Line'),
  status: string(name='Status'),
  locked: boolean(name='Locked'),
}

async function describeDomainRecordInfoWithOptions(request: DescribeDomainRecordInfoRequest, runtime: Util.RuntimeOptions): DescribeDomainRecordInfoResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainRecordInfo', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function describeDomainRecordInfo(request: DescribeDomainRecordInfoRequest): DescribeDomainRecordInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainRecordInfoWithOptions(request, runtime);
}

model DescribeDomainLogsRequest = {
  lang?: string(name='Lang'),
  keyWord?: string(name='KeyWord'),
  groupId?: string(name='GroupId'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='endDate'),
  type?: string(name='Type'),
}

model DescribeDomainLogsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  domainLogs: {
    domainLog: [
      {
        actionTime: string(name='ActionTime'),
        actionTimestamp: long(name='ActionTimestamp'),
        domainName: string(name='DomainName'),
        action: string(name='Action'),
        message: string(name='Message'),
        clientIp: string(name='ClientIp'),
        zoneId: string(name='ZoneId'),
      }
    ](name='DomainLog'),
  }(name='DomainLogs'),
}

async function describeDomainLogsWithOptions(request: DescribeDomainLogsRequest, runtime: Util.RuntimeOptions): DescribeDomainLogsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainLogs', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainLogs(request: DescribeDomainLogsRequest): DescribeDomainLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainLogsWithOptions(request, runtime);
}

model DescribeDomainInfoRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  needDetailAttributes?: boolean(name='NeedDetailAttributes'),
}

model DescribeDomainInfoResponse = {
  requestId: string(name='RequestId'),
  domainId: string(name='DomainId'),
  domainName: string(name='DomainName'),
  punyCode: string(name='PunyCode'),
  aliDomain: boolean(name='AliDomain'),
  remark: string(name='Remark'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
  instanceId: string(name='InstanceId'),
  versionCode: string(name='VersionCode'),
  versionName: string(name='VersionName'),
  minTtl: long(name='MinTtl'),
  recordLineTreeJson: string(name='RecordLineTreeJson'),
  lineType: string(name='LineType'),
  regionLines: boolean(name='RegionLines'),
  inBlackHole: boolean(name='InBlackHole'),
  inClean: boolean(name='InClean'),
  slaveDns: boolean(name='SlaveDns'),
  resourceGroupId: string(name='ResourceGroupId'),
  recordLines: {
    recordLine: [
      {
        lineCode: string(name='LineCode'),
        fatherCode: string(name='FatherCode'),
        lineName: string(name='LineName'),
        lineDisplayName: string(name='LineDisplayName'),
      }
    ](name='RecordLine'),
  }(name='RecordLines'),
  dnsServers: {
    dnsServer: [ string ](name='DnsServer'),
  }(name='DnsServers'),
  availableTtls: {
    availableTtl: [ string ](name='AvailableTtl'),
  }(name='AvailableTtls'),
}

async function describeDomainInfoWithOptions(request: DescribeDomainInfoRequest, runtime: Util.RuntimeOptions): DescribeDomainInfoResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainInfo', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainInfo(request: DescribeDomainInfoRequest): DescribeDomainInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainInfoWithOptions(request, runtime);
}

model DescribeDomainGroupsRequest = {
  lang?: string(name='Lang'),
  keyWord?: string(name='KeyWord'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
}

model DescribeDomainGroupsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  domainGroups: {
    domainGroup: [
      {
        groupId: string(name='GroupId'),
        groupName: string(name='GroupName'),
        domainCount: long(name='DomainCount'),
      }
    ](name='DomainGroup'),
  }(name='DomainGroups'),
}

async function describeDomainGroupsWithOptions(request: DescribeDomainGroupsRequest, runtime: Util.RuntimeOptions): DescribeDomainGroupsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDomainGroups', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDomainGroups(request: DescribeDomainGroupsRequest): DescribeDomainGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDomainGroupsWithOptions(request, runtime);
}

model DescribeDNSSLBSubDomainsRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  domainName: string(name='DomainName'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
}

model DescribeDNSSLBSubDomainsResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  slbSubDomains: {
    slbSubDomain: [
      {
        subDomain: string(name='SubDomain'),
        recordCount: long(name='RecordCount'),
        open: boolean(name='Open'),
        type: string(name='Type'),
      }
    ](name='SlbSubDomain'),
  }(name='SlbSubDomains'),
}

async function describeDNSSLBSubDomainsWithOptions(request: DescribeDNSSLBSubDomainsRequest, runtime: Util.RuntimeOptions): DescribeDNSSLBSubDomainsResponse {
  Util.validateModel(request);
  return doRequest('DescribeDNSSLBSubDomains', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDNSSLBSubDomains(request: DescribeDNSSLBSubDomainsRequest): DescribeDNSSLBSubDomainsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDNSSLBSubDomainsWithOptions(request, runtime);
}

model DescribeDnsProductInstancesRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  versionCode?: string(name='VersionCode'),
}

model DescribeDnsProductInstancesResponse = {
  requestId: string(name='RequestId'),
  totalCount: long(name='TotalCount'),
  pageNumber: long(name='PageNumber'),
  pageSize: long(name='PageSize'),
  dnsProducts: {
    dnsProduct: [
      {
        instanceId: string(name='InstanceId'),
        versionCode: string(name='VersionCode'),
        versionName: string(name='VersionName'),
        startTime: string(name='StartTime'),
        endTime: string(name='EndTime'),
        startTimestamp: long(name='StartTimestamp'),
        endTimestamp: long(name='EndTimestamp'),
        domain: string(name='Domain'),
        bindCount: long(name='BindCount'),
        bindUsedCount: long(name='BindUsedCount'),
        TTLMinValue: long(name='TTLMinValue'),
        subDomainLevel: long(name='SubDomainLevel'),
        dnsSLBCount: long(name='DnsSLBCount'),
        URLForwardCount: long(name='URLForwardCount'),
        DDosDefendFlow: long(name='DDosDefendFlow'),
        DDosDefendQuery: long(name='DDosDefendQuery'),
        overseaDDosDefendFlow: long(name='OverseaDDosDefendFlow'),
        searchEngineLines: string(name='SearchEngineLines'),
        ISPLines: string(name='ISPLines'),
        ISPRegionLines: string(name='ISPRegionLines'),
        overseaLine: string(name='OverseaLine'),
        monitorNodeCount: long(name='MonitorNodeCount'),
        monitorFrequency: long(name='MonitorFrequency'),
        monitorTaskCount: long(name='MonitorTaskCount'),
        regionLines: boolean(name='RegionLines'),
        gslb: boolean(name='Gslb'),
        inClean: boolean(name='InClean'),
        inBlackHole: boolean(name='InBlackHole'),
        bindDomainCount: long(name='BindDomainCount'),
        bindDomainUsedCount: long(name='BindDomainUsedCount'),
        dnsSecurity: string(name='DnsSecurity'),
      }
    ](name='DnsProduct'),
  }(name='DnsProducts'),
}

async function describeDnsProductInstancesWithOptions(request: DescribeDnsProductInstancesRequest, runtime: Util.RuntimeOptions): DescribeDnsProductInstancesResponse {
  Util.validateModel(request);
  return doRequest('DescribeDnsProductInstances', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function describeDnsProductInstances(request: DescribeDnsProductInstancesRequest): DescribeDnsProductInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDnsProductInstancesWithOptions(request, runtime);
}

model DeleteSubDomainRecordsRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  domainName: string(name='DomainName'),
  RR: string(name='RR'),
  type?: string(name='Type'),
}

model DeleteSubDomainRecordsResponse = {
  requestId: string(name='RequestId'),
  RR: string(name='RR'),
  totalCount: string(name='TotalCount'),
}

async function deleteSubDomainRecordsWithOptions(request: DeleteSubDomainRecordsRequest, runtime: Util.RuntimeOptions): DeleteSubDomainRecordsResponse {
  Util.validateModel(request);
  return doRequest('DeleteSubDomainRecords', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function deleteSubDomainRecords(request: DeleteSubDomainRecordsRequest): DeleteSubDomainRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSubDomainRecordsWithOptions(request, runtime);
}

model DeleteDomainRecordRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  recordId: string(name='RecordId'),
}

model DeleteDomainRecordResponse = {
  requestId: string(name='RequestId'),
  recordId: string(name='RecordId'),
}

async function deleteDomainRecordWithOptions(request: DeleteDomainRecordRequest, runtime: Util.RuntimeOptions): DeleteDomainRecordResponse {
  Util.validateModel(request);
  return doRequest('DeleteDomainRecord', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function deleteDomainRecord(request: DeleteDomainRecordRequest): DeleteDomainRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainRecordWithOptions(request, runtime);
}

model DeleteDomainGroupRequest = {
  lang?: string(name='Lang'),
  groupId: string(name='GroupId'),
}

model DeleteDomainGroupResponse = {
  requestId: string(name='RequestId'),
  groupName: string(name='GroupName'),
}

async function deleteDomainGroupWithOptions(request: DeleteDomainGroupRequest, runtime: Util.RuntimeOptions): DeleteDomainGroupResponse {
  Util.validateModel(request);
  return doRequest('DeleteDomainGroup', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function deleteDomainGroup(request: DeleteDomainGroupRequest): DeleteDomainGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainGroupWithOptions(request, runtime);
}

model DeleteDomainRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
}

model DeleteDomainResponse = {
  requestId: string(name='RequestId'),
  domainName: string(name='DomainName'),
}

async function deleteDomainWithOptions(request: DeleteDomainRequest, runtime: Util.RuntimeOptions): DeleteDomainResponse {
  Util.validateModel(request);
  return doRequest('DeleteDomain', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function deleteDomain(request: DeleteDomainRequest): DeleteDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainWithOptions(request, runtime);
}

model ChangeDomainOfDnsProductRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  instanceId: string(name='InstanceId'),
  newDomain?: string(name='NewDomain'),
  force?: boolean(name='Force'),
}

model ChangeDomainOfDnsProductResponse = {
  requestId: string(name='RequestId'),
  originalDomain: string(name='OriginalDomain'),
}

async function changeDomainOfDnsProductWithOptions(request: ChangeDomainOfDnsProductRequest, runtime: Util.RuntimeOptions): ChangeDomainOfDnsProductResponse {
  Util.validateModel(request);
  return doRequest('ChangeDomainOfDnsProduct', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function changeDomainOfDnsProduct(request: ChangeDomainOfDnsProductRequest): ChangeDomainOfDnsProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeDomainOfDnsProductWithOptions(request, runtime);
}

model ChangeDomainGroupRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  groupId?: string(name='GroupId'),
}

model ChangeDomainGroupResponse = {
  requestId: string(name='RequestId'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
}

async function changeDomainGroupWithOptions(request: ChangeDomainGroupRequest, runtime: Util.RuntimeOptions): ChangeDomainGroupResponse {
  Util.validateModel(request);
  return doRequest('ChangeDomainGroup', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function changeDomainGroup(request: ChangeDomainGroupRequest): ChangeDomainGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeDomainGroupWithOptions(request, runtime);
}

model AddDomainRecordRequest = {
  lang?: string(name='Lang'),
  userClientIp?: string(name='UserClientIp'),
  domainName: string(name='DomainName'),
  RR: string(name='RR'),
  type: string(name='Type'),
  value: string(name='Value'),
  TTL?: long(name='TTL'),
  priority?: long(name='Priority'),
  line?: string(name='Line'),
}

model AddDomainRecordResponse = {
  requestId: string(name='RequestId'),
  recordId: string(name='RecordId'),
}

async function addDomainRecordWithOptions(request: AddDomainRecordRequest, runtime: Util.RuntimeOptions): AddDomainRecordResponse {
  Util.validateModel(request);
  return doRequest('AddDomainRecord', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function addDomainRecord(request: AddDomainRecordRequest): AddDomainRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDomainRecordWithOptions(request, runtime);
}

model AddDomainGroupRequest = {
  lang?: string(name='Lang'),
  groupName: string(name='GroupName'),
}

model AddDomainGroupResponse = {
  requestId: string(name='RequestId'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
}

async function addDomainGroupWithOptions(request: AddDomainGroupRequest, runtime: Util.RuntimeOptions): AddDomainGroupResponse {
  Util.validateModel(request);
  return doRequest('AddDomainGroup', 'HTTPS', 'POST', '2015-01-09', 'AK', null, request, runtime);
}

async function addDomainGroup(request: AddDomainGroupRequest): AddDomainGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDomainGroupWithOptions(request, runtime);
}

model AddDomainRequest = {
  lang?: string(name='Lang'),
  domainName: string(name='DomainName'),
  groupId?: string(name='GroupId'),
  resourceGroupId?: string(name='ResourceGroupId'),
}

model AddDomainResponse = {
  requestId: string(name='RequestId'),
  domainId: string(name='DomainId'),
  domainName: string(name='DomainName'),
  punyCode: string(name='PunyCode'),
  groupId: string(name='GroupId'),
  groupName: string(name='GroupName'),
  dnsServers: {
    dnsServer: [ string ](name='DnsServer'),
  }(name='DnsServers'),
}

async function addDomainWithOptions(request: AddDomainRequest, runtime: Util.RuntimeOptions): AddDomainResponse {
  Util.validateModel(request);
  return doRequest('AddDomain', 'HTTPS', 'POST', '2015-01-09', 'AK,BearerToken', null, request, runtime);
}

async function addDomain(request: AddDomainRequest): AddDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDomainWithOptions(request, runtime);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
